package utils;

import org.apache.log4j.PropertyConfigurator;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by IntelliJ IDEA.
 * User: barrioss
 * Date: Jan 2, 2007
 * Time: 2:39:06 PM
 * To change this template use File | Settings | File Templates.
 */


public class Log4jInit extends HttpServlet {

      public  void init() {
        String prefix =  getServletContext().getRealPath("/");
        String file = getInitParameter("log4j-init-file");
        // if the log4j-init-file is not set, then no point in trying
        if(file != null) {
          PropertyConfigurator.configure(prefix+file);
        }
      }

      public
      void doGet(HttpServletRequest req, HttpServletResponse res) {
      }
    }


